package com.ssy.lingxi.platform.manage.controller.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.manage.api.model.dto.material.MaterialFileInfoDTO;
import com.ssy.lingxi.platform.manage.api.model.vo.material.MaterialFileFeignVO;
import com.ssy.lingxi.platform.manage.model.request.content.MaterialLibraryAddRequest;
import com.ssy.lingxi.platform.manage.service.content.IMaterialLibraryService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * 素材管理内部feign接口
 * @author xiechenhui
 * @version 2.0.0
 * @date 2022/3/31
 */
@RestController
@RequestMapping("/manage/feign/material/library")
public class MaterialLibraryFeignController {

    @Resource
    private IMaterialLibraryService materialLibraryService;

    /**
     * 根据会员id和角色id查询素材库信息
     * @param request 请求参数
     * @return 操作结果
     */
    @PostMapping(value = "/findAllByMemberIdAndRoleId")
    public Wrapper<List<MaterialFileFeignVO>> findAllByMemberIdAndRoleId(@Valid @RequestBody MaterialFileInfoDTO request) {
        return materialLibraryService.findAllByMemberIdAndRoleId(request);
    }
}
